home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6519 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: newspost1.alt.net!usenet
  2. From: Larry Buller <ljbuller@mail.btigate.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Global Variables
  5. Date: 9 Feb 1996 03:34:14 GMT
  6. Organization: AltNet - Affordable Usenet Access - http://www.alt.net
  7. Message-ID: <4fefbm$dhf@tofu.alt.net>
  8. Mime-Version: 1.0
  9. Content-Type: text/plain; charset=us-ascii
  10. Content-Transfer-Encoding: 7bit
  11. X-Mailer: Mozilla 1.22KIT (Windows; U; 16bit)
  12.  
  13. Help!!! I'm using visualc++ 4.0.  What I want to do is recall information 
  14. from an ini file... I already know how to do that.  What I can't seem to 
  15. figure out is how to reference global variables in other classes.  For 
  16. instance I can declare a variable outside of functions and class and That 
  17. is supposed to make it global.  If I delcare x in 1.h and define it in 
  18. 1.cpp then try to refer to x in 2.cpp I get an undeclared variable error. 
  19. If I make sure the declaration also exists in the 2.h, then I get a linker 
  20. error.  I know this has got to be a real simple answer, but I'll be darned 
  21. if I can find the answer.  Any body got help for this soul lost in c++ 
  22. hell?   Larry Buller
  23.  
  24.